package com.rankeiot.platform;

//import com.aliyun.dysmsapi20170525.Client;
import com.rankeiot.core.MenuManager;
import com.rankeiot.core.Module;
import com.rankeiot.core.config.ConfigManager;
import com.rankeiot.core.config.ControlType;
import com.rankeiot.core.config.IConfigItem;
import com.rankeiot.core.config.Item;
import com.rankeiot.core.util.LocaleUtil;
import com.rankeiot.platform.config.SmsConfigs;
import com.rankeiot.platform.service.SmsService;
import org.springframework.beans.BeansException;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

//@ConditionalOnClass(Client.class)
@Configuration
public class SmsConfiguration implements ApplicationContextAware {
    @Bean
    SmsService smsService(){
        return new SmsService();
    }
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException{
        ConfigManager.register(LocaleUtil.encode("阿里短信配置","Alibaba Cloud SMS"), SmsConfigs.class);
        MenuManager.regMenu(SmsMenu.class);
    }
}
